Passed
Push — master ( 12ba88...25e691 )
by Stefan
08:44
created

T_FUNCTION ➔ MapNoneDeleteCoord   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 1
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 1
1
/* 
2
 *******************************************************************************
3
 * Copyright 2011-2017 DANTE Ltd. and GÉANT on behalf of the GN3, GN3+, GN4-1 
4
 * and GN4-2 consortia
5
 *
6
 * License: see the web/copyright.php file in the file structure
7
 *******************************************************************************
8
 */
9
10
/* General function for doing HTTP XML GET requests. */
11
12
/* global marks */
13
/** global: marks */
14
15
function getXML(attribute_class) {
16
    var client = new XMLHttpRequest();
17
    client.attribute_class = attribute_class;
18
    client.onreadystatechange = addOption;
19
    client.open("GET", "inc/option_xhr.inc.php?class=" + attribute_class + "&etype=XML");
20
    client.send();
21
}
22
23
function addOption(attribute_class) {
24
    if (this.readyState === 4 && this.status === 200) {
25
        var field = document.getElementById("expandable_" + this.attribute_class + "_options");
26
        var div = document.createElement('tbody');
27
        div.innerHTML = this.responseText;
28
        field.appendChild(div.firstChild);
29
    }
30
}
31
32
function processCredentials() {
33
    if (this.readyState === 4 && this.status === 200) {
34
        var field = document.getElementById("disposable_credential_container");
35
        field.innerHTML = this.responseText;
36
    }
37
}
38
39
function doCredentialCheck(form) {
40
    postXML(processCredentials, form);
41
}
42
43
function deleteOption(identifier) {
44
    var field = document.getElementById(identifier);
45
    field.parentNode.removeChild(field);
46
}
47
48
function MapGoogleDeleteCoord(e) {
49
    marks[e - 1].setOptions({visible: false});
1 ignored issue
show
Bug introduced by
The variable marks seems to be never declared. If this is a global, consider adding a /** global: marks */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
50
}
51
52
function MapNoneDeleteCoord(e) {
53
    // we don't do anything special because there is no map widget at all
54
    e++;
0 ignored issues
show
Unused Code introduced by
The assignment to variable e seems to be never used. Consider removing it.
Loading history...
55
}